/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "sccntbconvorg")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sccntbconvorg.findAll", query = "SELECT s FROM Sccntbconvorg s"),
    @NamedQuery(name = "Sccntbconvorg.findBySccntbconvorgid", query = "SELECT s FROM Sccntbconvorg s WHERE s.sccntbconvorgid = :sccntbconvorgid"),
    @NamedQuery(name = "Sccntbconvorg.findByMonto", query = "SELECT s FROM Sccntbconvorg s WHERE s.monto = :monto")})
public class Sccntbconvorg implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sccntbconvorgid")
    private Integer sccntbconvorgid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "monto")
    private double monto;
    @JoinColumn(name = "scintborganismid", referencedColumnName = "scintborganismid")
    @ManyToOne(optional = false)
    private Scintborganism scintborganismid;
    @JoinColumn(name = "sccntbconvenioid", referencedColumnName = "sccntbconvenioid")
    @ManyToOne(optional = false)
    private Sccntbconvenio sccntbconvenioid;

    public Sccntbconvorg() {
    }

    public Sccntbconvorg(Integer sccntbconvorgid) {
        this.sccntbconvorgid = sccntbconvorgid;
    }

    public Sccntbconvorg(Integer sccntbconvorgid, double monto) {
        this.sccntbconvorgid = sccntbconvorgid;
        this.monto = monto;
    }

    public Integer getSccntbconvorgid() {
        return sccntbconvorgid;
    }

    public void setSccntbconvorgid(Integer sccntbconvorgid) {
        this.sccntbconvorgid = sccntbconvorgid;
    }

    public double getMonto() {
        return monto;
    }

    public void setMonto(double monto) {
        this.monto = monto;
    }

    public Scintborganism getScintborganismid() {
        return scintborganismid;
    }

    public void setScintborganismid(Scintborganism scintborganismid) {
        this.scintborganismid = scintborganismid;
    }

    public Sccntbconvenio getSccntbconvenioid() {
        return sccntbconvenioid;
    }

    public void setSccntbconvenioid(Sccntbconvenio sccntbconvenioid) {
        this.sccntbconvenioid = sccntbconvenioid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sccntbconvorgid != null ? sccntbconvorgid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sccntbconvorg)) {
            return false;
        }
        Sccntbconvorg other = (Sccntbconvorg) object;
        if ((this.sccntbconvorgid == null && other.sccntbconvorgid != null) || (this.sccntbconvorgid != null && !this.sccntbconvorgid.equals(other.sccntbconvorgid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Sccntbconvorg[ sccntbconvorgid=" + sccntbconvorgid + " ]";
    }
    
}
